import * as Cesium from 'cesium/Cesium'
var defaultLabelPixelOffset = new Cesium.Cartesian2(0, -9), MeasurementSettings = {};
MeasurementSettings.color = Cesium.Color.YELLOW,
    MeasurementSettings.labelFont = "16px Lucida Console",
    MeasurementSettings.textColor = Cesium.Color.WHITE,
    MeasurementSettings.backgroundColor = new Cesium.Color(.165, .165, .165, .8),
    MeasurementSettings.backgroundPadding = new Cesium.Cartesian2(7, 5),
    MeasurementSettings.getPolylineOptions = function (e) {
        return {
            show: (e = Cesium.defaultValue(e, Cesium.defaultValue.EMPTY_OBJECT)).show,
            ellipsoid: e.ellipsoid,
            width: Cesium.defaultValue(e.width, 3),
            color: Cesium.defaultValue(e.color, MeasurementSettings.color),
            depthFailColor: Cesium.defaultValue(Cesium.defaultValue(e.depthFailColor, e.color), MeasurementSettings.color),
            id: e.id,
            positions: e.positions,
            materialType: e.materialType,
            depthFailMaterialType: e.depthFailMaterialType,
            loop: e.loop,
            clampToGround: e.clampToGround,
            classificationType: e.classificationType,
            allowPicking: Cesium.defaultValue(e.allowPicking, !1)
        }
    }, MeasurementSettings.getPolygonOptions = function (e) {
    return {
        show: (e = Cesium.defaultValue(e, Cesium.defaultValue.EMPTY_OBJECT)).show,
        ellipsoid: e.ellipsoid,
        color: Cesium.defaultValue(e.color, MeasurementSettings.color),
        depthFailColor: Cesium.defaultValue(Cesium.defaultValue(e.depthFailColor, e.color), MeasurementSettings.color),
        id: e.id,
        positions: e.positions,
        clampToGround: e.clampToGround,
        classificationType: e.classificationType,
        allowPicking: Cesium.defaultValue(e.allowPicking, !1)
    }
}, MeasurementSettings.getPointOptions = function () {
    return {
        pixelSize: 10,
        color: MeasurementSettings.color,
        position: new Cesium.Cartesian3,
        disableDepthTestDistance: Number.POSITIVE_INFINITY,
        show: !1
    }
}, MeasurementSettings.getLabelOptions = function (e) {
    return e = Cesium.defaultValue(e, Cesium.defaultValue.EMPTY_OBJECT), {
        show: !1,
        font: MeasurementSettings.labelFont,
        scale: Cesium.defaultValue(e.scale, 1),
        fillColor: Cesium.defaultValue(e.fillColor, MeasurementSettings.textColor),
        showBackground: !0,
        backgroundColor: Cesium.defaultValue(e.backgroundColor, MeasurementSettings.backgroundColor),
        backgroundPadding: Cesium.defaultValue(e.backgroundPadding, MeasurementSettings.backgroundPadding),
        horizontalOrigin: Cesium.defaultValue(e.horizontalOrigin, Cesium.HorizontalOrigin.CENTER),
        verticalOrigin: Cesium.defaultValue(e.verticalOrigin, Cesium.VerticalOrigin.BOTTOM),
        pixelOffset: Cesium.defined(e.pixelOffset) ? e.pixelOffset : Cesium.Cartesian2.clone(defaultLabelPixelOffset),
        disableDepthTestDistance: Number.POSITIVE_INFINITY,
        position: new Cesium.Cartesian3
    }
};
export default MeasurementSettings;